/*********************************************************
 *  Copyright (c) 2011 by Web Information Systems (WIS) Group, 
 *  Delft University of Technology.
 *  Qi Gao, http://wis.ewi.tudelft.nl/index.php/home-qi-gao
 *  
 *  Some rights reserved.
 *
 *  Contact: q.gao@tudelft.nl
 *
 **********************************************************/
package org.persweb.genius.model;

import java.sql.Timestamp;
import java.util.List;

/**
 * @author Qi Gao <a href="mailto:q.gao@tudelft.nl">q.gao@tudelft.nl</a>
 * @version created on Jul 4, 2011 9:48:18 AM
 */
public class ItemImpl implements Item {

	/** id of the item */
	private Long ID = null;
	
	/** the id of user who publish the item */
	private Integer userId = -1;
	private String content = null;
	private Timestamp creationTime = null;
	private List<Concept> concepts = null;

	/**
	 * @param iD
	 */
	public ItemImpl(long iD) {
		super();
		ID = iD;
	}
	
	

	/**
	 * @param content
	 */
	public ItemImpl(String content) {
		super();
		this.content = content;
	}



	/**
	 * @param iD
	 * @param userId
	 * @param content
	 * @param creationTime
	 */
	public ItemImpl(long iD, Integer userId, String content,
			Timestamp creationTime) {
		super();
		ID = iD;
		this.userId = userId;
		this.content = content;
		this.creationTime = creationTime;
	}

	/**
	 * @param iD
	 * @param userId
	 * @param content
	 * @param creationTime
	 * @param concepts
	 */
	public ItemImpl(long iD, Integer userId, String content,
			Timestamp creationTime, List<Concept> concepts) {
		super();
		ID = iD;
		this.userId = userId;
		this.content = content;
		this.creationTime = creationTime;
		this.concepts = concepts;
	}

	/**
	 * @param concepts
	 */
	public ItemImpl(List<Concept> concepts) {
		super();
		this.concepts = concepts;
	}


	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#getContent()
	 */
	@Override
	public String getContent() {
		return content;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#getCreationTime()
	 */
	@Override
	public Timestamp getCreationTime() {
		return creationTime;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#getId()
	 */
	@Override
	public Long getId() {
		return ID;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#getUserId()
	 */
	@Override
	public Integer getUserId() {
		return userId;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#setContent(java.lang.Object)
	 */
	@Override
	public void setContent(String content) {
		this.content = content;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#setCreationTime(java.lang.Object)
	 */
	@Override
	public void setCreationTime(Timestamp creationTime) {
		this.creationTime = creationTime;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#setId(java.lang.Object)
	 */
	@Override
	public void setId(Long id) {
		ID = id;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#setUserid(java.lang.Object)
	 */
	@Override
	public void setUserid(Integer userId) {
		this.userId = userId;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#add(org.persweb.genius.model.Concept)
	 */
	@Override
	public void addConcept(Concept concept) {
		this.concepts.add(concept);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#getConcepts()
	 */
	@Override
	public List<Concept> getConcepts() {
		return concepts;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.persweb.genius.model.Item#setConcepts(java.util.List)
	 */
	@Override
	public void setConcepts(List<Concept> concepts) {
		this.concepts = concepts;
	}

	@Override
	public String toString() {
		return "ItemGenericImpl [ID=" + ID + ", content=" + content
				+ ", creationTime=" + creationTime + ", userId=" + userId + "]";
	}

}